/**
*@author       wuwg
*@createTime   2018/03/20
*@updateTime   2018/03/20
*@description
*@rule
 */
@import '../../../config/config.less';
@import "../../../mixins/input/input-mixins.less";
@import "../form-item/form-item.less";

//命名空间
@css-prefix-input: ~"@{css-prefix}input";

.input-error(~"@{css-prefix-form-item}");

.@{css-prefix-input} {
  // input style
  .input();
  //  input  wrap
  &-wrapper {
    display: inline-block;
    width: 100%;
    vertical-align: middle;
    line-height: normal
  }

  //  .aty-input-icon  style
  &-icon {
    position: absolute;
    cursor: default;
    top: 0;
    right: 0;
    z-index: 3;
    width: @input-icon-width;
    height: @input-height-base;
    line-height: @input-height-base;
    font-size: @input-icon-font-size;
    text-align: center;
    color: @subsidiary-color;
    + .@{css-prefix-input} {
      padding-right: @input-icon-width-small;
    }
  }

  //   hide  .aty-input-icon-validate  {}
  &-icon-validate {
    display: none;
  }
  //  hide  .aty-input-icon-clear  {}
  &-icon-clear {
    z-index: 4;
    display: none;
  }

  //  hover 时显示清除按钮，增加了show 类名
  &-wrapper:hover {
    .@{css-prefix-input}-icon-clear.show {
      display: inline-block;
    }
  }

  // large .aty-input-cion
  &-wrapper-large &-icon {
    width: @input-icon-width-large;
    font-size: @input-icon-font-size-large;
    height: @input-height-large;
    line-height: @input-height-large;

    + .@{css-prefix-input} {
      padding-right: @input-icon-width-large;
    }
  }

  // small .aty-input-cion
  &-wrapper-small &-icon {
    width: @input-icon-width-small;
    font-size: @input-icon-font-size-small;
    height: @input-height-small;
    line-height: @input-height-small;
    + .@{css-prefix-input} {
      padding-right: @input-icon-width-small;
    }
  }
}
.@{css-prefix-input}-group {
  .input-group(~"@{css-prefix-input}");
}

// inut 出错提示样式
.input-error(@class){
  .@{class}-error{
    .@{css-prefix-input} {
      .input-error();
      &-icon {
        color: @error-color;
      }
    }
    .@{css-prefix-input}-group {
      .input-group-error();
    }
  }
}

